#include <stdio.h>

struct VoteRecord {
  int id;
  char name[256];
  int count;
};

void print_vote_record(struct VoteRecord r) {
  printf("%d,%s,%d\n", r.id, r.name, r.count);
}

int main(int argc, char *argv[]) {
  struct VoteRecord results[4] = {{1, "Luo Ji", 0},
                                  {2, "Bill Hines", 0},
                                  {3, "Frederick Tyler", 0},
                                  {4, "Manuel Rey Diaz", 0}};
  // 定义一个指针，初始化为NULL
  struct VoteRecord *ptr = NULL;
  // 使用ptr遍历结构体数组中的每一个元素
  for (ptr = results; ptr < results + 4; ptr++) {
    // 打印每一条投票记录
    // ptr指向当前的数组元素
    printf("%d,%s,%d\n", ptr->id, ptr->name, ptr->count);
    // print_vote_record(*ptr);
  }
  return 0;
}
